import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
    int x= input.nextInt();
    print(x);

    }
    public static void print(int x){
        if(x<=9){
            System.out.println(x);
            return;
        }
        if(x>9){
            print(x/10);
            System.out.println(x%10);
        }

    }
}
